package com.lst.projectlib.util;

import android.content.Context;
import android.widget.ImageView;

import com.nostra13.universalimageloader.core.DisplayImageOptions;

import java.io.File;

import me.nereo.multi_image_selector.MultiImageLoader;

/**
 * Created by Martin on 2017/1/17.
 */

public class UniversalImageLoader implements MultiImageLoader {

  public UniversalImageLoader(Context context) {
    init(context);
  }

  private void init(Context context) {
    ImageLoaderUtil.getInstance().init(context);
  }

  @Override
  public void bindImage(ImageView imageView, File file, String TAG, int width, int height) {
    DisplayImageOptions.Builder builder = ImageLoaderUtil.getInstance().getDisplayImageBuilder().cacheInMemory(true).cacheOnDisk(false);
    ImageLoaderUtil.getInstance().displayImage("file://" + file.getPath(),imageView,false,width, height,-1,builder);
  }

  @Override
  public void bindImage(ImageView imageView, File file) {
    bindImage(imageView,file,null,100,100);
  }

  @Override
  public void pauseTag(String tag) {
  }

  @Override
  public void resumeTag(String tag) {
  }
}
